让 Typecho 支持 Emoji 表情
前言
嘿嘿嘿,最近没文章可写啦,只能水水水!
正文
首先修改数据库编码啦
1. 修改数据库编码
进入 PhpMyadmin,在博客数据所在数据库的设置(操作 - 排序规则)中,选择 utf8mb4_unicode_ci
2. 修改数据库表编码
执行以
下 sql 语句
alter table typecho_comments convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_contents convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_fields convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_metas convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_options convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_relationships convert to character set utf8mb4 collate
utf8mb4_unicode_ci;
alter table typecho_users convert to character set utf8mb4 collate utf8mb4_unicode_ci;
数据库表名中的 typecho 自行修改为数据库表前缀
3. 修改数据库配置文件
修改网站根目录数据库配置文件 (config.inc.php) 中,大约第五行'charset' => 'utf8',
中的utf8
改为utf8mb4
$db->addServer(array (
'host' => localhost,
'user' => 'youruser',
'password' => 'yourpassword',
'charset' => 'utf8mb4', //修改这一行
'port' => 3306,
'database' => 'yourdatabase' ), Typecho_Db::READ | Typecho_Db::WRITE);
然后就可以装疯啦!
让 Typecho 支持 Emoji 表情
https://blog.xsy.fun/posts/2018-05-27 让 Typecho 支持 Emoji 表情/